#pragma once
#include "BasicType.h"
#include "TagList.h"
#include "Stream.h"
#include "Pool.h"

namespace LightPlayer{

	class ActionRecord{
	public:
		ActionCode		m_ActionCode;
		Stream			m_Data;

		ActionRecord();
		void init();
		void SetActionCode(uint8 action_code)									{ SetActionCode( (ActionCode)action_code ); }
		void SetActionCode(ActionCode action_code)								{m_ActionCode = action_code;}					

		void readFromStream( Stream* stream );
		const char* getString()													{ return getActionString((ActionCode)m_ActionCode);};
		ActionCode	getActionCode() const										{ return m_ActionCode; }
	};

	typedef Stream ActionRecordList;
	//typedef array<ActionRecordList*> ActionList;

	class ActionList {
		pool<ActionRecordList>		m_ActionRecordListPool;
		array<ActionRecordList*>	m_ActionList;
	public:
		ActionList();
		void init();
		void clear();
		
		void push_back( const uint8* start_actions, uint32 size_of_actions );
		uint32 size();
		ActionRecordList*& operator[]( const uint32& index ){
			return m_ActionList[index];
		}
	};
};